<?php
declare (strict_types=1);

namespace app\admin\controller\store;

use app\admin\model\store\Pink as PinkModel;
use think\facade\View;
use think\Request;

class Pink
{

    protected $pagesize;

    public function __construct()
    {
        $this->pagesize = config('setting.pagesize');
    }

    /**
     * 显示资源列表
     * @return \think\Response
     */
    public function index()
    {
        View::engine()->layout(false);
        $status = request()->get('status');
        if (!empty($status)) {
            $where  ['status'] = $status;
            $data = PinkModel::getPink()->where($where)->with('user', 'order', 'pinkConfig', 'goodsSkuId')->paginate($this->pagesize);
        } else {
            $data = PinkModel::getPink()->with('user', 'order', 'pinkConfig', 'goodsSkuId')->paginate($this->pagesize);
        }
        View::assign('data', $data);
        return View::fetch();
    }
}
